home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12041 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.itd.umich.edu!usenet
  2. From: raffel@umich.edu (David Raffel)
  3. Newsgroups: comp.os.vms,comp.sys.dec,comp.lang.c
  4. Subject: getting correct local time in VAX C program
  5. Date: 28 Mar 1996 15:43:34 GMT
  6. Organization: UM
  7. Message-ID: <4jec36$ff3@lastactionhero.rs.itd.umich.edu>
  8. NNTP-Posting-Host: host-46.subnet-74.med.umich.edu
  9. Mime-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11. X-Newsreader: WinVN 0.99.7
  12.  
  13.  
  14. I'm having a problem using the c localtime function to convert a
  15. "timestamp" (represented in seconds since 1/1/1970) to a date
  16. and time.  I'm running under VMS V5.5-2 and using VAXC V3.1.
  17.  
  18. The problem is that the timestamp is being written out to a file
  19. by a SUN which takes into account timezone information.  When I
  20. read the timestamp on VMS and convert it, I get the correct date,
  21. but the time is off by 5 hours.  I assume that this is because
  22. the VAX doesn't use any timezone information and always returns
  23. GMT.
  24.  
  25. When I call time() to get the current time in seconds, the
  26. time returned on VMS is different by 18000 seconds from the
  27. time returned on the SUN.
  28.  
  29. Are there any routines available that will return the correct
  30. local time, or any suggestions for how I can get the correct
  31. time?
  32.  
  33. Thanks!
  34.  
  35. David Raffel
  36. raffel@umich.edu
  37.  
  38.  
  39.